import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * User: wenxiwen
 * Date: 2022/2/17
 * Time: 21:25
 * Description: No Description
 */
public class TestDemo {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int input=scan.nextInt();

        for(int i=0;i<32;i++) {
            if((i+1)%2!=0) {
                System.out.print((input>>i)&1);
            }
        }
        System.out.println();
        for(int i=0;i<32;i++) {
            if((i+1)%2==0) {
                System.out.print((input>>i)&1);
            }
        }
    }
    public static void main2(String[] args) {
        Scanner scan=new Scanner(System.in);
        int input=scan.nextInt();
        int count=0;

        for(int i=0;i<32;i++) {
            if(((input>>i)&1)==1) {
                count++;
            }
        }
        System.out.println(count);
    }
    public static void main1(String[] args) {
        Scanner scan=new Scanner(System.in);

        int n=scan.nextInt();
        int count=0;

        while(n!=0)
        {
            n=n&(n-1);
            count++;
        }
        System.out.println(count);
    }
}
